import java.util.*;
public class _12152{
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int[] a = new int[1000000];
        int t= sc.nextInt();
        for(int r= 0;r<t;r++){
            int n=sc.nextInt();
            int all=0;
            for(int i=0;i<n;i++){
                a[i]=sc.nextInt();
                all+=a[i];
            }if(all%2==0){
                System.out.println("0");
            }else
                System.out.println(fuck(a,n));
            all=0;
        }
    }
    public static int fuck(int[] a,int n){
        int min=100000000;
        int amount=0;
        for(int i=0;i<n;i++){
            amount=0;
            if(a[i]%2==0){
                while(a[i]%2==0){
                    amount++;
                    a[i]=a[i]/2;
                }
            }else {
                while(a[i]%2==1){
                    amount++;
                    a[i]=a[i]/2;
                }
            }
            min=Math.min(amount, min);
        }
        return min;
    }
}